package ift605.testDynamicServer.server;

import java.net.InetAddress;
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

import udes.ds.rmi.hw.Equation;

@SuppressWarnings("serial")
public class MyServer extends UnicastRemoteObject implements MyServerPublicInterface{

	protected MyServer() throws RemoteException {
		super();
	}

	public static void main(String[] args) {
		try {
			MyServer server = new MyServer();
			Naming.rebind("MyServer", server);
			
			try
			{
				System.out.println("IP Address : " + InetAddress.getLocalHost().getHostAddress());
			}
			catch( Exception e){}
		} 
		catch (RemoteException e) {e.printStackTrace();}
		catch (MalformedURLException e) {e.printStackTrace();}
	}

	@Override
	public void execute(Task aTask) throws RemoteException {
		aTask.DoSomething();
	}

}
